#include <cstdio>

int n, a[ 500 ];

void init( )
{
    int i;
    for ( i = 0; i < n; i++ )
        scanf("%d", &a[ i ]);
    
}

void work( )
{
    int ac[ 500 ], i, j, cnt;
    for ( i = 0; i < n; i++ )
        ac[ i ] = -1;
    for ( i = 0; i < n; i++ )
    {
        cnt = 0;
        for ( j = 0; j < n; j++ )
            if ( ac[ j ] == -1 )
            {
                cnt++;
                if ( cnt == a[ i ] + 1 )
                    break;
            }
        ac[ j ] = i;
    }
    printf("%d", ac[ 0 ] + 1);
    for ( i = 1; i < n; i++ )
        printf(",%d", ac[ i ] + 1);
    printf("\n");
}

int main( )
{
    while ( scanf("%d", &n) && n )
    {
        init( );
        work( );
    }
    return 0;
}
